<template>
  <n-drawer class="check-info" v-model:show="infoDrawerActive" width="90%">
    <n-drawer-content body-style="--n-body-padding:0" closable>
      <template #header>
        <p class="my-title--primary">查看详情</p>
      </template>
      <div class="i-grid">
        <div class="i-grid_item">
          <span>编号：3233242424234234</span>
        </div>
        <div class="i-grid_item">
          <span>盘点时间：3233242424234234</span>
        </div>
        <div class="i-grid_item">
          <span>盘点人：李四</span>
        </div>
      </div>
      <div class="i-goods-item">
        <div class="i-goods-item_header">
          <div class="h_left">
            <p class="h_left--name">b1-23带腿带袖体雕衣</p>
            <p class="h_left--alias">b1-23带腿带袖体雕衣</p>
          </div>
          <div class="h_right">
            <div class="h_right__mark">
              <div>实际库存</div>
              <div>修改后库存</div>
            </div>
            <div class="h_right__item">
              商品数量：6件
            </div>
          </div>
        </div>
      </div>
      <div class="i-table">
        <stock-table takeStock :list="['',
        { value1: 'A', },
        { value1: 'B', },
        { value1: 'C', },
        { value1: '紫色', },
        { value1: 1, value2: 10 },
        { value1: 2, value2: 10 },
        { value1: 3, value2: 10 },
        { value1: '肤色', },
        { value1: 4, value2: 10 },
        { value1: 5, value2: 10 },
        { value1: 6, value2: 10 },
        { value1: '黑色', },
        { value1: 7, value2: 10 },
        { value1: 8, value2: 10 },
        { value1: 9, value2: 10 }]"></stock-table>
      </div>
      <template #footer>
        <div class="i-footer">
          <div class="i-footer_item">
            合计商品数量：1000件
          </div>
          <button class="my-btn--primary">确认</button>
        </div>
      </template>
    </n-drawer-content>
  </n-drawer>
  <slot></slot>
</template>

<script setup>
import {
  ref,
  inject,
  provide,
  reactive
} from "vue";

import stockTable from "../@fragment/stock-table.vue";
const infoDrawerActive = inject('infoDrawerActive');

</script>

<style lang="less" scoped>
.check-info {
  .i-grid {
    display: grid;
    grid-template-columns: 40% 30% 30%;
    width: 1590px;
    height: 100px;
    padding: 20px 30px;
    margin: 20px;
    background: #f8f8f8;
    border-radius: 4px;

    &_item {
      margin: 10px 0;
      font-size: 24px;
      font-weight: 500;
      color: #4a5060;
    }
  }

  .i-table {
    margin: 0 30px;
  }

  .i-goods-item {
    margin-left: 30px;
    margin-right: 60px;

    &_header {
      display: flex;
      justify-content: space-between;
      margin: 30px 0;

      .h_left {
        &--name {
          font-size: 24px;
          font-weight: 500;
          color: #2e323d;
        }

        &--alias {
          font-size: 20px;
          font-weight: 500;
          color: #4a5060;
        }
      }

      .h_right {
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        &__mark {
          display: flex;

          > div {
            position: relative;
            margin-left: 60px;
            font-size: 26px;
            font-weight: 500;
            color: #4a5060;

            &:nth-child(1) {
              &::before {
                position: absolute;
                top: 10px;
                left: -35px;
                content: "";
                width: 26px;
                height: 26px;
                background: #4a5060;
                border-radius: 4px;
              }
            }

            &:nth-child(2) {
              &::before {
                position: absolute;
                top: 10px;
                left: -35px;
                content: "";
                width: 26px;
                height: 26px;
                background: #1981f4;
                border-radius: 4px;
              }
            }
          }
        }
        &__item {
          height: 60px;
          padding: 0 30px;
          margin: 0 10px;
          font-size: 24px;
          font-weight: bold;
          color: #666;
          line-height: 60px;
          background: #f7f7f7;
          border-radius: 5px;
        }

        &__line {
          width: 1px;
          height: 30px;
          margin: 0 20px;
          background: #d8d8d8;
        }
      }
    }
  }

  .i-table {
    margin: 20px 40px 20px 20px;
  }

  .i-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;

    &_item {
      margin: 0 20px;
      font-size: 26px;
    }

    > button {
      margin-left: 30px;
    }
  }
}
</style>